//
//  UIImage+YSFromColor.h
//  YSKitDemo
//
//  Created by MOLBASE on 2018/8/9.
//  Copyright © 2018年 YangShen. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/// 渐变方向
typedef NS_ENUM(NSUInteger, YSGradientDirection) {
    YSGradientDirectionLeft,         // 向左
    YSGradientDirectionRight,        // 向右
    YSGradientDirectionTop,          // 向上
    YSGradientDirectionBottom,       // 向下
    YSGradientDirectionTopLeft,      // 左上
    YSGradientDirectionTopRight,     // 右上
    YSGradientDirectionBottomLeft,   // 左下
    YSGradientDirectionBottomRight,  // 右下
};

@interface UIImage (YSFromColor)

+ (instancetype)ys_imageWithColor:(nonnull UIColor *)color;
+ (instancetype)ys_imageWithColor:(nonnull UIColor *)color size:(CGSize)size;

+ (instancetype)ys_imageWithGradientColors:(nonnull NSArray<UIColor *> *)colors direction:(YSGradientDirection)direction;
+ (instancetype)ys_imageWithGradientColors:(nonnull NSArray<UIColor *> *)colors direction:(YSGradientDirection)direction size:(CGSize)size;

@end

NS_ASSUME_NONNULL_END
